package com.yanqu.road.server.cmd.activity.xingyoushanshui;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.XingYouShanShuiProto;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.xingyou.CrossXingYouActivity;
import com.yanqu.road.server.manager.activity.xingyou.CrossXingYouShanShuiMgr;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_XING_YOU_SHAN_SHUI_BATTLE_DATA_UPLOAD, desc = "玩家战斗数据上报")
public class CrossShanShuiBattleDataUploadCmd extends CrossUnionCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        XingYouShanShuiProto.CrossShanShuiBattleDataUpload req = XingYouShanShuiProto.CrossShanShuiBattleDataUpload.parseFrom(packet.getBytes());
        int activityId = req.getActivityId();
        CrossXingYouActivity activity = CrossXingYouShanShuiMgr.getActivity(activityId, groupId);
        if(activity != null){
            activity.updateUserAbility(serverId, packet.getPlayerId(), req.getDetailList(), req.getNeedBack());
        }
    }

    @Override
    public void sendData() {

    }
}
